
Page({

  data: {
    region:["湖南省","长沙市","天心区"]
  },
  goBack:function(){
    
   wx.navigateBack({
   delta: 1,

})
  },
  getUserProfile:function(){
    wx.getUserProfile({
      desc: '用于完善会员信息',
      success(res){
        console.log(res);
      }
    })
  },
  selectPayType:function(){

    wx.showActionSheet({
      itemList: ["支付宝","微信","VISA","万事达","银联","京东支付"],
      success(index){
        console.log(index);
      }
    })
  },
  login:function(){
    var postdata = {"name":"admin","password":"123"}
    wx.login({
      success(res){
        wx.showLoading({
          title:'正在加载...',
          icon:"loading"
        });
        wx.request({
          url: 'http://anli-wechat.boruiman.com/freshmenapp/user/login',
          data:postdata,
          method:"POST",
          success(res){
            console.log(res);
            wx.hideLoading()
            // wx.showToast({
            //   title: res.data.msg,
            //   icon:"success"
            // })

          }
        })
        console.log(res);
      }
    })
  },
  submitInfo:function(e){
    console.log(e);
  },
  goSignPage:function(){
    wx.redirectTo({
      url: '../sign/sign'
    })
  },
  checkboxChange:function(e){
    console.log(e);
  },
  dateChange:function(e){
    this.setData({
      date:e.detail.value
    })
   
  },
  regionChange:function(e){
    var t = this;
    t.setData({
      region:e.detail.value
    })
  }
})
